{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Histograms, Binnings, and Density"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A simple histogram can be a great first step in understanding a dataset.\n",
    "Earlier, we saw a preview of Matplotlib's histogram function (discussed in [Comparisons, Masks, and Boolean Logic](02.06-Boolean-Arrays-and-Masks.ipynb)), which creates a basic histogram in one line, once the normal boilerplate imports are done (see the following figure):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "plt.style.use('seaborn-white')\n",
    "\n",
    "rng = np.random.default_rng(1701)\n",
    "data = rng.normal(size=1000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXEAAAD0CAYAAABtjRZ7AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAQEUlEQVR4nO3dfUiV9//H8dfxWLN5lJBiTezGvtsYKW2TQ9sf1gJrJxytYoY1ScrYRmw2oVl21qxWWaPZYJoVDmKUUTkhhMb4NUnCajmEFRotgtoqbTMk9Jy1tHOu3x+xM6zl3Y5effT5+Ktz5+d9gp58znWuKx2WZVkCABgpwu4BAAADR8QBwGBEHAAMRsQBwGBEHAAMFjlUC/31119qbGzU+PHj5XQ6h2pZADBaIBBQa2urkpOTFRUV9cjjQxbxxsZGZWVlDdVyADCsVFRUyO12P3L/kEV8/PjxoUEmTJgwVMsCgNFu3bqlrKysUEMfNmQR//sQyoQJE5SQkDBUywLAsPC4w9B8sQkAButxJ97V1SWv16ubN2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w4d0tdff60tW7bYPVKfnDx5UpJ0+PBh5eXl6csvv7R5ou6Muuy+v5YvXx46Lae5uVmxsbE2T9Q3y5cv1+jRoyU92AU89ZQ55+WkpKRozpw5OnLkiN2j9KqnU2KfdJMmTVJJSYnWrl1r9yh9Nm/ePHk8HkmSZVnGnOAwZ84czZ49W9KT2ZFhE/HKykp988033e4rKirS9OnTlZ2drcuXL2v//v02Tfd4Pc3d2tqq/Px8eb1em6Z7vMfNnZ6ernPnztk0Vf/0dErsk87j8Qz4vGO7REdHS3rw97569Wrl5eXZO1A/REZGat26dTpx4oS++uoru8fpzhohrly5YqWlpdk9Rp9dunTJSk9Pt2pra+0epd9+/PFHKy8vz+4xelVUVGQdP348dHvmzJk2TtN/169ftxYvXmz3GP3S3NxsLVq0yKqsrLR7lAH5448/rNmzZ1t+v9/uUUKG9THxffv26dixY5Ie7AJM+fh25coVffTRRyouLtbrr79u9zjDVkpKik6dOiVJj5wSi/C7ffu2cnJylJ+fr4yMDLvH6bNjx45p3759kqQxY8bI4XAoIuLJSeeT/7nxP3j77be1bt06VVVVKRAIqKioyO6R+qS4uFidnZ3atm2bpAcXUe3Zs8fmqYafuXPn6vTp01qyZEnolFgMnr1796q9vV1lZWUqKyuT9OAL2qioKJsn69kbb7yh9evXKysrS/fv35fX632iZh7WpxgCwHD35HwmAAD0GxEHAIMRcQAwGBEHAIMRcQAwGBEHAIMRcQAwGBEHAIP9P4W73E5pca9GAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.hist(data);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The `hist` function has many options to tune both the calculation and the display; \n",
    "here's an example of a more customized histogram, shown in the following figure:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [
    {
     "data":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63W3V1dXrllVe0ZcuWVJeTyJpkTp8+bZWUlKS6jJsyODholZWVWX//+99TXcpNO3HihLVhw4ZUl2GrqanJOnr0aHy7qKgohdXcnLNnz1o//elPU13GTfvggw+sH/3oR9bBgwdTXcqXcv78eevBBx+0wuFwqkuJmxRr6C+88IIOHz4s6crM4E75eSdJp0+f1i9+8Qu1trZqwYIFqS7HWH6/X4FAQJKuuzwXE+/ChQtauXKlamtr9ZOf/CTV5Yzb4cOH9cILL0iSMjIy5HA45HTePjF6e/+enCA//vGPVVdXp0OHDuny5ctqampKdUnj1traqkgkot///veSrtzMdfVZOpg4paWl6uvrU0VFRfzyXCTP9u3bdfHiRbW1tamtrU3SlRO8U6ZMSXFlX+z73/++fv3rX2vZsmWKRqPauHHjbVXzpLhsEQAmg9vntwIA4JYQ6ABgCAIdAAxBoAOAIQh0ADAEgQ4AhiDQAcAQBDoAGOL/AI2anw//lbLzAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.hist(data, bins=30, density=True, alpha=0.5,\n",
    "         histtype='stepfilled', color='steelblue',\n",
    "         edgecolor='none');"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The `plt.hist` docstring has more information on other available customization options.\n",
    "I find this combination of `histtype='stepfilled'` along with some transparency `alpha` to be helpful when comparing histograms of several distributions (see the following figure):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW4AAAD0CAYAAAC7KMweAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAS50lEQVR4nO3dfWxU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aSW644QZ72s+yrIy+sL5q1SpVVlbq5Zdf9rqUtHbv3q2ioiLdc889ikajWrZsmdclpXTJJZeoq6tLyWRS0WjUXoiRaYa0qjfffFN/+tOfepw799xzNWLECL300kvas2ePHn30UW3YsGEoy+olVZ0XXHCBKioqNGnSJI+q6i1VnaFQSFOmTFFbW5sefvhhLV++3KPqUutreWkmGT16tKST9f7hD3/Q/fff721Babz99tsaO3asgsFgRgf30aNHdfDgQa1bt07ffvutFi9erC1btignJ8fr0no466yzdODAAc2aNUtHjx7VunXrvC4pNctj999/v7Vlyxb7+KqrrvKwmvSuv/56q6qqyqqqqrKKi4ut+fPne11SWi0tLVZFRYW1fft2r0vpJRQKWR9++KF9HAwGPaymbwcPHrRuueUW68033/S6lLTmz59vLViwwKqqqrKmTZtmzZ492/ruu++8LquXZ555xnrllVfs45tuuslqb2/3sKLUQqGQ9eyzz1qWdfLfv7y83Dpx4oTHVfXmeZszbdo07dixQzNnzlRLS4vOP/98r0tK6ZNPPrEfX3fddXr11Vc9rCa9r776Svfdd59Wr16dUe8OTulreWkmaW9v11133aWamhpdeeWVXpeTVvd3p9XV1VqxYoXGjRvnYUWpTZs2TX/+859155136rvvvtNPP/2kMWPGeF1WL+ecc47y8vIkSb/61a+USCTS3r3oJc+De+7cuXr88cc1d+5cWZalJ554wuuSjPbcc88pHo/rqaeeknTyJqlTe8tkgvLycjU1NamystJeXpqJ1q1bp+PHj2vNmjVas2aNJOmPf/xjRl8AzGTXXnut9uzZozlz5siyLNXU1GTkdYM77rhDy5cv1/z589XZ2akHHnhAZ52VeusJL3m+HBAA0D+eLwcEAPQPwQ0AhiG4AcAwBDcAGIbgBgDDENwAYBiCGwAMQ3ADgGH+D1u83Fv+SXrbAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "x1 = rng.normal(0, 0.8, 1000)\n",
    "x2 = rng.normal(-2, 1, 1000)\n",
    "x3 = rng.normal(3, 2, 1000)\n",
    "\n",
    "kwargs = dict(histtype='stepfilled', alpha=0.3, density=True, bins=40)\n",
    "\n",
    "plt.hist(x1, **kwargs)\n",
    "plt.hist(x2, **kwargs)\n",
    "plt.hist(x3, **kwargs);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If you are interested in computing, but not displaying, the histogram (that is, counting the number of points in a given bin), you can use the `np.histogram` function:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 23 241 491 224  21]\n"
     ]
    }
   ],
   "source": [
    "counts, bin_edges = np.histogram(data, bins=5)\n",
    "print(counts)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Two-Dimensional Histograms and Binnings\n",
    "\n",
    "Just as we create histograms in one dimension by dividing the number line into bins, we can also create histograms in two dimensions by dividing points among two-dimensional bins.\n",
    "We'll take a brief look at several ways to do this here.\n",
    "We'll start by defining some data—an `x` and `y` array drawn from a multivariate Gaussian distribution:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [],
   "source": [
    "mean = [0, 0]\n",
    "cov = [[1, 1], [1, 2]]\n",
    "x, y = rng.multivariate_normal(mean, cov, 10000).T"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### plt.hist2d: Two-dimensional histogram\n",
    "\n",
    "One straightforward way to plot a two-dimensional histogram is to use Matplotlib's `plt.hist2d` function (see the following figure):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWYAAAD3CAY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jAyUlpbC7XZj5cqVfunHmjVrUF9fjxUrVgC4XuTuz/vz/Wn06NHYt28fkpOTPeVKnVl+fj6uXbuG9evXY/369QCuX5gMDg72aT9+8YtfYOHChZg8eTIaGhqQmZnp8z50RqxjJiLSGP5NQkSkMQxmIiKNYTATEWkMg5mISGMYzEREGsNgJiLSGAYzEZHG/B8mza1L3E/2dgAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.hist2d(x, y, bins=30)\n",
    "cb = plt.colorbar()\n",
    "cb.set_label('counts in bin')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Just like `plt.hist`, `plt.hist2d` has a number of extra options to fine-tune the plot and the binning, which are nicely outlined in the function docstring.\n",
    "Further, just as `plt.hist` has a counterpart in `np.histogram`, `plt.hist2d` has a counterpart in `np.histogram2d`:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(30, 30)\n"
     ]
    }
   ],
   "source": [
    "counts, xedges, yedges = np.histogram2d(x, y, bins=30)\n",
    "print(counts.shape)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For the generalization of this histogram binning when there are more than two dimensions, see the `np.histogramdd` function."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### plt.hexbin: Hexagonal binnings\n",
    "\n",
    "The two-dimensional histogram creates a tesselation of squares across the axes.\n",
    "Another natural shape for such a tesselation is the regular hexagon.\n",
    "For this purpose, Matplotlib provides the `plt.hexbin` routine, which represents a two-dimensional dataset binned within a grid of hexagons (see the following figure):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWYAAAD0CAYAAACo/4zqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAABA9klEQVR4nO2de5BUVX7Hv/1+Ts97mBkGREBkicHHEkGzoGaLwphsaVmKiDtK3PxjdlXEUpCV0d1E0TJSpkypkYquAlExuLXmWRtxSyIk7K4KykODYI0jj6Hn0TP9ft78MfW7nr59X9PTPdPd8/tUTc1Mn3vuPfd23+89/XsdiyRJEhiGYZiKwTrVA2AYhmHyYWFmGIapMFiYGYZhKgwWZoZhmAqDhZlhGKbCsJdjp4lEAkeOHEFraytsNls5DsEwTI2QzWYRDAZxySWXwO12F72fUCiESCRialu/34+Ghoaij1VuyiLMR44cwR133FGOXTMMU6Ps2rULS5YsKapvKBTCkiVLTE8E6+vr8etf/7pixbkswtza2gpg7EK3t7eX4xAMw9QI586dwx133CHrRjFEIhHYbDb09fUhk8nobmu32+U+ojAfPnwYf/u3f4sdO3bIr/3Lv/wLdu7cibfeegsAsHv3brz55puw2+245557cN111xU9Zt0xlmOn9NRqb29HV1dXOQ7BMEyNUQqzZy6XQy6XM9xGyfbt2/Huu+/C4/HIrx07dgz//M//DMrBCwaD2LFjB/bs2YNkMom1a9fij//4j+F0Oic8biXs/GMYpmawWq2mfpTMnj0bzz//vPz/8PAwtm3bhs2bN8uvffrpp7j88svhdDpRV1eH2bNn4/PPPy/PeZRlrwzDMFOAxWIx9aNk1apVsokjm83ipz/9KR555BH4fD55m0gkgrq6Ovl/n89n2tk4XspiymAYhpkq1IR3PBw9ehS9vb14/PHHkUwm8eWXX+KJJ57AsmXLEI1G5e2i0WieUJcSFmaGYWoGrRmxchs9Fi9ejH/7t38DAHzzzTfYsGEDfvrTnyIYDOK5555DMplEKpXCyZMnsWDBgpKNXYSFmWGY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Y3377bbz22mt5r3V2duKGG27AwoULp2hU5UftvJ988kksXrwYwWAQDz30EDZv3jxFo5scKi1UabLw+XwAxs7/vvvuw/r166d2QJPEO++8g6amJixfvhwvv/zyVA+nIqloG/PKlSvR3t4OADh06BAWL16MXbt2TfGoJocvvvgCGzZswMMPP4xrrrlmqodTVrZu3YpLL70UN9xwAwBgxYoV2Ldv3xSPanI4e/YsfvzjH2Pt2rW45ZZbpno4k8Idd9whFxs6fvw45syZgxdffBGtra1TPbTKQaoSrrvuOimRSEz1MCaFEydOSKtWrZKOHz8+1UOZFP7zP/9T2rhxoyRJkvTJJ59IP/rRj6Z4RJNDMBiUrr/+eunAgQNTPZQp44c//KH05ZdfTvUwKo7a/q5YpTz77LNIpVJ44oknAIwFv9eyM2zlypXYv38/1qxZI4cqTQdeeukljI6O4oUXXsALL7wAANi+fTs7xJjKNmUwDMNMRyo6KoNhGGY6wsLMMAxTYbAwMwzDVBgszAzDMBUGCzPDMEyFwcLMMAxTYbAwMwzDVBgszAzDMBXG/wPusp0P1vDpYgAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.hexbin(x, y, gridsize=30)\n",
    "cb = plt.colorbar(label='count in bin')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`plt.hexbin` has a number of additional options, including the ability to specify weights for each point and to change the output in each bin to any NumPy aggregate (mean of weights, standard deviation of weights, etc.)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Kernel density estimation\n",
    "\n",
    "Another common method for estimating and representing densities in multiple dimensions is *kernel density estimation* (KDE).\n",
    "This will be discussed more fully in [In-Depth: Kernel Density Estimation](05.13-Kernel-Density-Estimation.ipynb), but for now I'll simply mention that KDE can be thought of as a way to \"smear out\" the points in space and add up the result to obtain a smooth function.\n",
    "One extremely quick and simple KDE implementation exists in the `scipy.stats` package.\n",
    "Here is a quick example of using KDE (see the following figure):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWgAAAD3CAYAAAAwos73AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAjLUlEQVR4nO3de1Bc5f0/8De7myWEJWA0MW3t2obIpBoZLqm1QzEhiNiM1nrhEhCH0tpIx1yQBhQTRJoQoqKp1ZB42yqiQEq1mVptwiSGyKi1NDRDK9igZhKjyUaMYddkF9jz+4Nv9pcNew7Lwwl79uT9mmEmex6es5+D8uHZ5xomSZIEIiLSHEOwAyAiIv+YoImINIoJmohIo5igiYg0igmaiEijmKCJiDTKJFpx69at2LVrFwYHB7F06VJkZWWpGRcR0QVPKEG///772LdvH1599VWcOnUKL7zwgtpxERFd8MJEFqrU1dUhLCwM//vf/+BwOFBWVoarr77aW3769Gl0d3dj5syZMBqNqgZMRPoyPDwMu92O+fPnY+rUqcL3OXHiBBwOR0Dfa7FYEBMTI/xek0WoBf3VV1/hyJEj2LJlCw4fPozi4mK89dZbCAsLAwB0d3cjPz9f1UCJSN8aGxuxYMECobonTpzAggULAm4QRkdHY8eOHZpP0kIJOiYmBnPmzIHZbMacOXMQHh6O/v5+XHzxxQCAmTNnAhj5gc+ePVu9aIlId7744gvk5+d784YIh8MBo9GIQ4cOYWhoSPF7TSaTt44uE3RycjJeeukl/OIXv8CxY8dw6tQpnwc981ds9uzZuOyyy1QJlIj0TY3uUI/HA4/HM+b3hAqhBJ2WloYPPvgAd9xxByRJQmVlJfuaiSjoDAYDDAbl2cNjlWuJ8DS7srIyNeMgIpqwsLAw71iY0veECuEETUSkRaGUgMfCBE1EusEWNBGRRjFBExFpVCC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rvJTpLQs06osuvRZZSqz1KHkqj7hRcoi3opKQk7N69G0uWLEFXVxfi4uK8ZfHx8di0aRNcLhfcbjf6+voQHx+Pv//9797vSUlJwRNPPKHeg/yfkEnQRETnS0ZGBjo6OpCbmwtJklBTUwObzQar1Yr09HQUFBQgLy8PkiShpKRk0s5hZYImIt0QXeptMBhQXV3tcy02Ntb77+zsbGRnZ8ves6OjY5yRBoZ90EREGsUWNBHpht5WEuoiQYv8wEUHCUX2W57MPYvl7qf2ftWiQumXg0KTnv4f00WCJiIC9NeCZh80EZFGsQVNRLqhtw37QydSIqILTMi0oNUeCFQisrJOK/1ak9k60MozE52htz7okEnQRERjYYImItIovSVo9kETEWkUW9BEpBtnNuwf63tCxYRa0H19fUhOTobL5VIrHiIiYaL7QWuVcAva4XBg48aNMJvN464rOrtCTVpZ+izys+Dya6ILg1CWkiQJa9euxX333YeIiAi1YyIiEnLBtaC3bduGF1980efat7/9bSxZsgTz5s07b4EREY2X3mZxjJmgs7KykJWV5XMtIyMDra2taG1thd1uR1FRERobG89bkEREgbjgErQ/O3fu9P578eLFeOGFF1QLiIhIFBO0CiZroC0U/kNofek4UShhgj7Hrl271IiDiIjOwYUqRKQboi1oj8eDqqoq9Pb2wmw2Y926dbj88su95S0tLWhqaoLJZEJxcTHS0tJw5MgRVFRUYHh4GJIkobq6GnPmzFH1ebjUm4h0RWSKXVtbG9xuN5qbm1FaWora2lpvmd1uR0NDA5qamvD888/j8ccfh9vtxu9//3vceeedaGhowLJly/D444+r/ixsQRORboi2oDs7O5GamgoASEhIQHd3t7ds//79SExMhNlshtlshtVqRU9PD8rLyxEVFQUAGB4eRnh4uIpPMoIJmoh0QzRBOxwOWCwW72uj0YihoSGYTCY4HA5vIgaAyMhIOBwOzJgxAwDw8ccfY+PGjXj66adVeor/TxcJOpRGZYlIeywWC5xOp/e1x+OByWTyW+Z0Or0J+7333sPDDz+MRx55RPX+Z4B90ESkI6JLvZOSktDe3g4A6OrqQlxcnLcsPj4enZ2dc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KC8vR2trK4aHh1FTUxPskAAAdXV1cLvdWL9+PYCRCe1n1u+Tr4yMDHR0dCA3N9c7jYnkbdmyBSdPnsTmzZuxefNmACODmVOnTg1yZMANN9yABx54APn5+RgaGkJFRYUm4tKjkJhmR0R0IeLnEiIijWKCJiLSKCZoIiKNYoImItIoJmgiIo1igiYi0igmaCIijfp/OqsZgbxC49kAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from scipy.stats import gaussian_kde\n",
    "\n",
    "# fit an array of size [Ndim, Nsamples]\n",
    "data = np.vstack([x, y])\n",
    "kde = gaussian_kde(data)\n",
    "\n",
    "# evaluate on a regular grid\n",
    "xgrid = np.linspace(-3.5, 3.5, 40)\n",
    "ygrid = np.linspace(-6, 6, 40)\n",
    "Xgrid, Ygrid = np.meshgrid(xgrid, ygrid)\n",
    "Z = kde.evaluate(np.vstack([Xgrid.ravel(), Ygrid.ravel()]))\n",
    "\n",
    "# Plot the result as an image\n",
    "plt.imshow(Z.reshape(Xgrid.shape),\n",
    "           origin='lower', aspect='auto',\n",
    "           extent=[-3.5, 3.5, -6, 6])\n",
    "cb = plt.colorbar()\n",
    "cb.set_label(\"density\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "KDE has a smoothing length that effectively slides the knob between detail and smoothness (one example of the ubiquitous bias–variance trade-off).\n",
    "The literature on choosing an appropriate smoothing length is vast; `gaussian_kde` uses a rule of thumb to attempt to find a nearly optimal smoothing length for the input data.\n",
    "\n",
    "Other KDE implementations are available within the SciPy ecosystem, each with its own strengths and weaknesses; see, for example, `sklearn.neighbors.KernelDensity` and `statsmodels.nonparametric.KDEMultivariate`.\n",
    "For visualizations based on KDE, using Matplotlib tends to be overly verbose.\n",
    "The Seaborn library, discussed in [Visualization With Seaborn](04.14-Visualization-With-Seaborn.ipynb), provides a much more compact API for creating KDE-based visualizations."
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "jupytext": {
   "encoding": "# -*- coding: utf-8 -*-",
   "formats": "ipynb,md"
  },
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
